Vue.component('v-chart', VueECharts)
new Vue({
    el: '#app',
    data:function() {
        return {
            isReady: true, //数据是否已经准备好,防止页面闪现大括号{{}}
            activeDialogIndex: '', //模态窗索引
            tab:1,
            stat1:{
                productList:new Array(4).fill({
                    name:'某某产品…',
                    qy:'武汉生物',
                    qslrzl:'1000',
                    qsxszl:'500',
                    qskczl:'9500'
                })
            },
            stat2: {
                chartOption: {}
            },            
            stat3: {
                chartOption: {}
            },
            stat4: {
                chartOption: {},
                productList:new Array(4).fill({
                    name:'XXX产品',
                    lrzl:1000,
                    xszl:20,
                    kczl:980
                })
            }
            
        }
    },
    created:function() {
        this.createStat2()
        this.createStat3()
        this.createStat4()
    },
    methods: {
        submitForm:function(){},
        createStat2:function() { //产品近6个月抽查不合格变化趋势
            var lableList = ['1月', '2月', '3月', '4月', '5月', '6月']
            var dataList = [
               200,300,350,250,350,420]
            this.stat2.chartOption = AllOptions.createOption2(lableList, dataList,'个','不合格','rgba(245, 96, 35, 1)')
        },
        createStat3:function() { //产品近6个月不良反应趋势
            var lableList = ['1月', '2月', '3月', '4月', '5月', '6月']
            var dataList = [
               420,200,300,350,350,250]
            this.stat3.chartOption = AllOptions.createOption2(lableList, dataList,'例','不良反应','rgba(56, 235, 249, 1)')
        },
        createStat4:function() {
            var that = this;
            var dataList = [ //重点是经纬度（企业经纬度）
                {
                    name: "杭州市",
                    value: {
                        cityId:'123'
                    },
                },
                {
                    name: "舟山市",
                    value:  {
                        cityId:'124'
                    },
                },
                {
                    name: "金华市",
                    value:  {
                        cityId:'125'
                    },
                },
                {
                    name: "永嘉县",
                    value:  {
                        cityId:'126'
                    },
                },
            ]
            $.get('/src/js/zj.json', function (mapJson) {
                that.stat4.chartOption = AllOptions.createOption4(mapJson, dataList)
            })
        },
        showMapInfo(item){
            console.log('item',item.data)
             $('#modal1').modal()
        },
        goBack(){
            window.history.go(-1)
        }
    }
})